package Demo15;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-21
 * Time: 16:16
 */
import java.util.Scanner;
abstract class Door{
    public abstract void open();
    public abstract void close();
}
interface Fangdao{
    void Fd();
}
interface Fanghuo{
    void Fh();
}
/* 请在这里填写答案 */
class RoomDoor extends Door{

    public void open() {
        System.out.print("正在打开房门！");
    }

    @Override
    public void close() {
        System.out.print("正在关闭房门！");
    }
}
class CarDoor extends Door implements Fangdao,Fanghuo{
    @Override
    public void open() {
        System.out.print("正在打开车门！");
    }

    @Override
    public void close() {
        System.out.println("正在关闭车门！");
    }

    @Override
    public void Fd() {
        System.out.println("车门有防盗功能！");
    }

    @Override
    public void Fh() {
        System.out.println("车门有防火功能！");

    }
}
class Person{
    private String name;

    public Person(String name) {
        this.name = name;
    }
    void useDoor(Door door){
        System.out.print(name);
        door.open();
        System.out.print("\n"+name);
        door.close();
    }
    void Fangd(CarDoor door){
        door.Fd();
    }
    void Fangh(CarDoor door){
        door.Fh();
    }
}


public class Main{
    public static void main(String args[]){
        Scanner scan=new Scanner(System.in);
        Person p1=new Person(scan.next());
        Person p2=new Person(scan.next());
        CarDoor c=new CarDoor();
        RoomDoor r=new RoomDoor();
        p1.useDoor(c);
        p1.Fangd(c);
        p1.Fangh(c);
        System.out.println("====================");
        p2.useDoor(r);
    }
}